<template>
  <div id="enter">
    <p id="username" @click="login"><span @click="login">登录</span>&nbsp;&nbsp;|&nbsp;&nbsp;<span @click="writeBlog">写博客</span></p>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        title: ''
      }
    },
    methods: {
      checkDetail: function () {
        this.$router.push('/details')
      },
      login: function () {
        this.$router.push('/login')
      },
      writeBlog: function () {
        this.$router.push('/writeBlog')
      }
    },
    mounted:function(){
      var hr=window.location.href;
      var username=hr.split("username=")[1];
     // console.log(username);
      $("#username").html('hello,'+decodeURI(username));
      //console.log(username);
    }
  }
</script>

<style scoped>
p{
  position:absolute;
  top:10px;
  font-size:15px;
  right:100px;
}
span{
  display: inline-block;
}
span:hover{
  cursor: pointer;
}
</style>
